extends Polygon2D

var BLUR_ANITIME = 0.5
var MAX_BLUR = 0.009

func _ready():
	material.set_shader_param("radius",0)

func blur_in():
	visible = true
	var tween =  SDTween.new()
	add_child(tween)
	tween.interpolate_property(self,"material:shader_param/radius",0,MAX_BLUR,BLUR_ANITIME,Tween.TRANS_CUBIC,Tween.EASE_IN_OUT)
	tween.start()

func blur_out():
	visible = true
	var tween =  SDTween.new(self,"become_invisible")
	add_child(tween)
	tween.interpolate_property(self,"material:shader_param/radius",MAX_BLUR,0,BLUR_ANITIME,Tween.TRANS_CUBIC,Tween.EASE_IN_OUT)
	tween.start()

func become_invisible():
	visible = false
